
package com.fis.mca.persistence;

import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

import com.fis.mca.util.StringUtil;


/**
 * <p>Java class for mcaPackage complex type.
 * 
 * <p>The following schema fragment specifies the expected content contained within this class.
 * 
 * <pre>
 * &lt;complexType name="mcaPackage">
 *   &lt;complexContent>
 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       &lt;sequence>
 *         &lt;element name="cdrDetails" type="{http://www.w3.org/2001/XMLSchema}anyType" maxOccurs="unbounded" minOccurs="0"/>
 *         &lt;element name="code" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         &lt;element name="cycleChargeDetails" type="{http://www.w3.org/2001/XMLSchema}anyType" maxOccurs="unbounded" minOccurs="0"/>
 *         &lt;element name="cycleFees" type="{http://www.w3.org/2001/XMLSchema}anyType" maxOccurs="unbounded" minOccurs="0"/>
 *         &lt;element name="description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         &lt;element name="mcaPackageAttachedsForChildPackageId" type="{http://www.w3.org/2001/XMLSchema}anyType" maxOccurs="unbounded" minOccurs="0"/>
 *         &lt;element name="mcaPackageAttachedsForParentPackageId" type="{http://www.w3.org/2001/XMLSchema}anyType" maxOccurs="unbounded" minOccurs="0"/>
 *         &lt;element name="mcaService" type="{http://packages.mca.fis.com/}mcaService" minOccurs="0"/>
 *         &lt;element name="mcaSmsCommands" type="{http://www.w3.org/2001/XMLSchema}anyType" maxOccurs="unbounded" minOccurs="0"/>
 *         &lt;element name="mcaSubPackages" type="{http://www.w3.org/2001/XMLSchema}anyType" maxOccurs="unbounded" minOccurs="0"/>
 *         &lt;element name="mcaSubPromDetails" type="{http://www.w3.org/2001/XMLSchema}anyType" maxOccurs="unbounded" minOccurs="0"/>
 *         &lt;element name="name" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         &lt;element name="packageId" type="{http://www.w3.org/2001/XMLSchema}int"/>
 *         &lt;element name="promotionDetails" type="{http://www.w3.org/2001/XMLSchema}anyType" maxOccurs="unbounded" minOccurs="0"/>
 *         &lt;element name="status" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         &lt;element name="tariffPlans" type="{http://www.w3.org/2001/XMLSchema}anyType" maxOccurs="unbounded" minOccurs="0"/>
 *         &lt;element name="type" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *       &lt;/sequence>
 *     &lt;/restriction>
 *   &lt;/complexContent>
 * &lt;/complexType>
 * </pre>
 * 
 * 
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "mcaPackage", propOrder = {
    "cdrDetails",
    "code",
    "cycleChargeDetails",
    "cycleFees",
    "description",
    "mcaPackageAttachedsForChildPackageId",
    "mcaPackageAttachedsForParentPackageId",
    "mcaService",
    "mcaSmsCommands",
    "mcaSubPackages",
    "mcaSubPromDetails",
    "name",
    "packageId",
    "promotionDetails",
    "status",
    "tariffPlans",
    "type"
})
public class McaPackage implements Comparable<McaPackage>{

    @XmlElement(nillable = true)
    protected List<Object> cdrDetails;
    protected String code;
    @XmlElement(nillable = true)
    protected List<Object> cycleChargeDetails;
    @XmlElement(nillable = true)
    protected List<Object> cycleFees;
    protected String description;
    @XmlElement(nillable = true)
    protected List<Object> mcaPackageAttachedsForChildPackageId;
    @XmlElement(nillable = true)
    protected List<Object> mcaPackageAttachedsForParentPackageId;
    protected McaService mcaService;
    @XmlElement(nillable = true)
    protected List<Object> mcaSmsCommands;
    @XmlElement(nillable = true)
    protected List<Object> mcaSubPackages;
    @XmlElement(nillable = true)
    protected List<Object> mcaSubPromDetails;
    protected String name;
    protected int packageId;
    @XmlElement(nillable = true)
    protected List<Object> promotionDetails;
    protected String status;
    @XmlElement(nillable = true)
    protected List<Object> tariffPlans;
    protected String type;

    /**
     * Gets the value of the cdrDetails property.
     * 
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the cdrDetails property.
     * 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getCdrDetails().add(newItem);
     * </pre>
     * 
     * 
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link Object }
     * 
     * 
     */
    public List<Object> getCdrDetails() {
        if (cdrDetails == null) {
            cdrDetails = new ArrayList<Object>();
        }
        return this.cdrDetails;
    }

    /**
     * Gets the value of the code property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getCode() {
        return code;
    }

    /**
     * Sets the value of the code property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setCode(String value) {
        this.code = value.trim().toUpperCase();
    }

    /**
     * Gets the value of the cycleChargeDetails property.
     * 
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the cycleChargeDetails property.
     * 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getCycleChargeDetails().add(newItem);
     * </pre>
     * 
     * 
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link Object }
     * 
     * 
     */
    public List<Object> getCycleChargeDetails() {
        if (cycleChargeDetails == null) {
            cycleChargeDetails = new ArrayList<Object>();
        }
        return this.cycleChargeDetails;
    }

    /**
     * Gets the value of the cycleFees property.
     * 
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the cycleFees property.
     * 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getCycleFees().add(newItem);
     * </pre>
     * 
     * 
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link Object }
     * 
     * 
     */
    public List<Object> getCycleFees() {
        if (cycleFees == null) {
            cycleFees = new ArrayList<Object>();
        }
        return this.cycleFees;
    }

    /**
     * Gets the value of the description property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getDescription() {
        return description;
    }

    /**
     * Sets the value of the description property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setDescription(String value) {
        this.description = (value == null) ? value : value.trim();
    }

    /**
     * Gets the value of the mcaPackageAttachedsForChildPackageId property.
     * 
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the mcaPackageAttachedsForChildPackageId property.
     * 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getMcaPackageAttachedsForChildPackageId().add(newItem);
     * </pre>
     * 
     * 
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link Object }
     * 
     * 
     */
    public List<Object> getMcaPackageAttachedsForChildPackageId() {
        if (mcaPackageAttachedsForChildPackageId == null) {
            mcaPackageAttachedsForChildPackageId = new ArrayList<Object>();
        }
        return this.mcaPackageAttachedsForChildPackageId;
    }

    /**
     * Gets the value of the mcaPackageAttachedsForParentPackageId property.
     * 
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the mcaPackageAttachedsForParentPackageId property.
     * 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getMcaPackageAttachedsForParentPackageId().add(newItem);
     * </pre>
     * 
     * 
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link Object }
     * 
     * 
     */
    public List<Object> getMcaPackageAttachedsForParentPackageId() {
        if (mcaPackageAttachedsForParentPackageId == null) {
            mcaPackageAttachedsForParentPackageId = new ArrayList<Object>();
        }
        return this.mcaPackageAttachedsForParentPackageId;
    }

    /**
     * Gets the value of the mcaService property.
     * 
     * @return
     *     possible object is
     *     {@link McaService }
     *     
     */
    public McaService getMcaService() {
        return mcaService;
    }

    /**
     * Sets the value of the mcaService property.
     * 
     * @param value
     *     allowed object is
     *     {@link McaService }
     *     
     */
    public void setMcaService(McaService value) {
        this.mcaService = value;
    }

    /**
     * Gets the value of the mcaSmsCommands property.
     * 
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the mcaSmsCommands property.
     * 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getMcaSmsCommands().add(newItem);
     * </pre>
     * 
     * 
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link Object }
     * 
     * 
     */
    public List<Object> getMcaSmsCommands() {
        if (mcaSmsCommands == null) {
            mcaSmsCommands = new ArrayList<Object>();
        }
        return this.mcaSmsCommands;
    }

    /**
     * Gets the value of the mcaSubPackages property.
     * 
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the mcaSubPackages property.
     * 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getMcaSubPackages().add(newItem);
     * </pre>
     * 
     * 
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link Object }
     * 
     * 
     */
    public List<Object> getMcaSubPackages() {
        if (mcaSubPackages == null) {
            mcaSubPackages = new ArrayList<Object>();
        }
        return this.mcaSubPackages;
    }

    /**
     * Gets the value of the mcaSubPromDetails property.
     * 
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the mcaSubPromDetails property.
     * 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getMcaSubPromDetails().add(newItem);
     * </pre>
     * 
     * 
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link Object }
     * 
     * 
     */
    public List<Object> getMcaSubPromDetails() {
        if (mcaSubPromDetails == null) {
            mcaSubPromDetails = new ArrayList<Object>();
        }
        return this.mcaSubPromDetails;
    }

    /**
     * Gets the value of the name property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getName() {
        return name;
    }

    /**
     * Sets the value of the name property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setName(String value) {
        this.name = value.trim();
    }

    /**
     * Gets the value of the packageId property.
     * 
     */
    public int getPackageId() {
        return packageId;
    }

    /**
     * Sets the value of the packageId property.
     * 
     */
    public void setPackageId(int value) {
        this.packageId = value;
    }

    /**
     * Gets the value of the promotionDetails property.
     * 
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the promotionDetails property.
     * 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getPromotionDetails().add(newItem);
     * </pre>
     * 
     * 
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link Object }
     * 
     * 
     */
    public List<Object> getPromotionDetails() {
        if (promotionDetails == null) {
            promotionDetails = new ArrayList<Object>();
        }
        return this.promotionDetails;
    }

    /**
     * Gets the value of the status property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getStatus() {
        return status;
    }

    /**
     * Sets the value of the status property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setStatus(String value) {
        this.status = value;
    }

    /**
     * Gets the value of the tariffPlans property.
     * 
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the tariffPlans property.
     * 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getTariffPlans().add(newItem);
     * </pre>
     * 
     * 
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link Object }
     * 
     * 
     */
    public List<Object> getTariffPlans() {
        if (tariffPlans == null) {
            tariffPlans = new ArrayList<Object>();
        }
        return this.tariffPlans;
    }

    /**
     * Gets the value of the type property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getType() {
        return type;
    }

    /**
     * Sets the value of the type property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setType(String value) {
        this.type = value;
    }
    @Override 
    public String toString()
    {
    	return this.name;
    }
    public boolean equals(Object obj)
	{
		if (this == obj)
		{
			return true;
		}
		if ((obj == null) || (obj.getClass() != this.getClass()))
		{
			return false;
		}
		// object must be Test at this point
		McaPackage mcaPackage = (McaPackage) obj;
		return packageId == mcaPackage.getPackageId();
	}

	@Override
	public int compareTo(McaPackage o)
	{
		String o1 = this.getName();
		String o2 = o.getName();
		return StringUtil.compareVietnameseString(o1, o2);
	}

}
